<!--
  @author tanghongjun
  @since 2019年8月27日14:35:06
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<div class="layui-card-body" th:fragment="table" style="padding-top: 0;">
    <div class="zmn-table-top"
         style="box-sizing:border-box; padding: 0 10px; width: 100%; height:40px;line-height:40px; border-bottom: 1px solid #e6e6e6;">
        <form action="" class="layui-form" lay-filter="zmn-form">
            <div class="layui-form-item">
                <zmn th:if="${productFaultTariff.status != null && faultTariff.tariffType != 4}">
                    <label class="layui-form-label" style="margin-top: 5px;width: 100px;padding-left: 0;">显示全部项目：</label>
                    <div class="layui-input-inline" style="width:80px;" id="isButton">
                        <input id="showAllItems" th:checked="${isShowAllItems}" type="checkbox" name="open" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                    </div>

                    <div class="layui-input-inline" style="width:600px;">
                        <label  style="color: #9F9F9F;">显示：展示选择的项目分组下全部项目；不显示：展示项目分组下已勾选的项目</label>
                    </div>
                </zmn>

                <h4 style="float: right;">
                    <a  th:href="|/product/tariff/addEditProductPrice.action?productId=${productId}&tariffId=${tariffId}|" th:if="${#authPermit.checkPermit('/product/tariff/addEditProductPrice.action')}"
                        style="color: #00a0e9">设置价格表</a>
                </h4>
            </div>
        </form>


    </div>

    <zmn th:each="productFaultGroupVO:${productFaultGroupVOList}">
        <div class="zmn-table-top"
             style="box-sizing:border-box; padding: 0 10px; width: 100%; height:40px;line-height:40px; background-color:#f2f2f2;border: 1px solid #e6e6e6;border-bottom: none;margin-top: 20px">
            <h4 style="float: left;"><b><span th:text="${productFaultGroupVO.groupName+'(ID:'+productFaultGroupVO.groupId+')'}"></span></b></h4>
        </div>

        <table class="layui-table table-filter" th:id="${'zmn-table'+productFaultGroupVO.groupId}" th:lay-filter="${'zmn-table'+productFaultGroupVO.groupId}" style="margin-top: -1px;">
            <thead>
            <tr>
                <th lay-data="{field:'sort', width:80, unresize:false, sort:true, align:'center', fixed:'left'}" style="width: 80px;text-align: center">排序</th>
                <th lay-data="{field:'itemId', width:80, unresize:false, align:'center', fixed:'left'}" style="width: 100px;text-align: center">项目ID</th>
                <th lay-data="{field:'itemName',minWidth:120, unresize:false, align:'center', fixed:'left'}" style="min-width: auto;">项目名称</th>
                <th lay-data="{field:'categName', width:100, unresize:false, align:'center'}" style="width: 130px;text-align: center">项目类型名称</th>
                <th lay-data="{field:'general', width:80, unresize:false, align:'center', templet: '#generalTpl'}" style="width: 120px;text-align: center">是否默认</th>
                <th lay-data="{field:'priceStandard', width:80,unresize:false, align:'center'}" style="width: 100px;text-align: center">一口价</th>
                <th lay-data="{field:'priceSplit', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">区分明细</th>

                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'price', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">销售价</th>
                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'internalSettlementPrice', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">内部结算价</th>
                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'externalSettlementPrice', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">外部结算价</th>
                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'hourFee', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">技术工时费</th>
                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'prafficFee', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">往返路途费</th>
                <th th:if="${faultTariff.tariffType == 4}" lay-data="{field:'partPrice', width:80, unresize:false, align:'center'}" style="width: 120px;text-align: center">配件费</th>

                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'status', width:60, unresize:false, align:'center'}" style="width: 120px;text-align: center">勾选</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'price', width:140, unresize:false, align:'center',templet: '#switchTpl',edit:json.productFaultTariff.status==2?'text':false}" style="width: 140px;text-align: center">销售价</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'internalSettlementPrice', width:110, unresize:false, templet: '#internalSettlementPriceTpl', align:'center', edit:json.productFaultTariff.status==2?'text':false}" style="width: 110px;text-align: center">内部结算价</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'externalSettlementPrice', width:110, unresize:false, templet: '#externalSettlementPriceTpl', align:'center', edit:json.productFaultTariff.status==2?'text':false}" style="width: 110px;text-align: center">外部结算价</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'trafficFee', width:90, unresize:false, templet: '#trafficFeeTpl', align:'center', edit:false}" style="width: 110px;text-align: center">路途往返费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'hourFee', width:90, unresize:false, templet: '#hourFeeTpl', align:'center'}" style="width: 110px;text-align: center">工时费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'checkFee', width:90, unresize:false, templet: '#checkFeeTpl', align:'center'}" style="width: 110px;text-align: center">检测费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'servicePrice', width:90, unresize:false, templet: '#servicePriceTpl', align:'center'}" style="width: 110px;text-align: center">技术服务费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'partPrice', width:90, unresize:false, templet: '#partPriceTpl', align:'center'}" style="width: 110px;text-align: center">配件包干费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'artPrice', width:90, unresize:false, templet: '#artPriceTpl', align:'center'}" style="width: 110px;text-align: center">工艺费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'guaranteePrice', width:90, unresize:false, templet: '#guaranteePriceTpl', align:'center'}" style="width: 110px;text-align: center">保修费</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'unit', width:60, unresize:false, align:'center'}" style="width: 110px;text-align: center">单位</th>

                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'mutexMode', minWidth:80, unresize:false, align:'center'}" style="text-align: center">互斥性</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'cityLimit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">城市系数</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'brandLimit', minWidth:80, unresize:false, align:'center'}" style="text-align: center">品牌系数</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'editEnable', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">APP编辑</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'show', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">APP显示</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'takePicture', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">工程师拍照</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'manualPrice', minWidth:80, unresize:false, align:'center'}" style="wtext-align: center">修改价格</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'desc', minWidth:80, unresize:false, align:'center'}" style="text-align: center">项目说明</th>
                <!--                <th lay-data="{field:'afterService', minWidth:80, unresize:false, align:'center'}" style="text-align: center">是否保修</th>-->
                <!--                <th lay-data="{field:'afterServiceDesc', minWidth:80, unresize:false, align:'center'}">保修范围</th>-->
                <!--                <th lay-data="{field:'afterServiceDay', minWidth:80, unresize:false, align:'center'}" style="text-align: center">保修天数</th>-->


                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'serviceRatio', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">技术服务费率</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'partRatio', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">配件包干费率</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'artRatio', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">工艺费费率</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'guaranteeRatio', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">保修费费率</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'groupId', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">配件包干费率</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'negotiableMinPrice', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">面议最低价</th>
                <th th:if="${faultTariff.tariffType != 4}" lay-data="{field:'negotiableMaxPrice', width:110, unresize:false, align:'center', hide:true}" style="width: 110px;text-align: center">面议最高价</th>

                <th th:if="${#authPermit.checkPermit('/product/tariff/item/city/price/list.action') && faultTariff != null && (faultTariff.priceType == 2 || faultTariff.tariffType == 4)}" lay-data="{field:'操作', minWidth:100, unresize:false, align:'center', fixed:'right'}">操作</th>
            </tr>
            </thead>

            <tbody>
            <tr th:each="item:${productFaultGroupVO.items}">
                <td th:text="${item.sort}" style="text-align: center">sort</td>
                <td th:text="${item.itemId}" style="text-align: center">itemId</td>
                <td th:text="${item.itemName}" class="layui-gray">itemName</td>
                <td th:text="${item.categName}" style="text-align: center" class="layui-gray">categName</td>
                <td th:text="${item.general==2?'默认':'非默认'}" style="text-align: center" class="layui-gray">general</td>
                <td th:text="${item.priceStandard==2?'一口价':'非一口价'}" style="text-align: center" class="layui-gray">priceStandard</td>
                <td th:text="${item.priceSplit==2?'区分':'不区分'}" style="text-align: center" class="layui-gray">priceSplit</td>

                <td th:if="${faultTariff.tariffType == 4}"  th:text="${item.priceYuan}" style="text-align: center"  class="layui-gray">priceYuan</td>
                <td th:if="${faultTariff.tariffType == 4}" th:text="${item.internalSettlementPriceYuan}" style="text-align: center">internalSettlementPriceYuan</td>
                <td th:if="${faultTariff.tariffType == 4}" th:text="${item.externalSettlementPriceYuan}" style="text-align: center">externalSettlementPriceYuan</td>
                <td th:if="${faultTariff.tariffType == 4}" th:text="${item.hourFeeYuan}" style="text-align: center">sort</td>
                <td th:if="${faultTariff.tariffType == 4}" th:text="${item.trafficFeeYuan}" style="text-align: center">sort</td>
                <td th:if="${faultTariff.tariffType == 4}" th:text="${item.partPriceYuan}" style="text-align: center">sort</td>



                <td th:if="${faultTariff.tariffType != 4}" style="text-align: center" class="layui-gray">
                    <input type="checkbox" id="status" name="status" lay-filter="status" lay-skin="primary" th:checked="${item.status==2}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${#numbers.formatDecimal(item.priceYuan,1,'COMMA',2,'POINT')}" style="text-align: right" class="layui-gray">priceYuan</td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${#numbers.formatDecimal(item.internalSettlementPriceYuan,1,'COMMA',2,'POINT')}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${#numbers.formatDecimal(item.externalSettlementPriceYuan,1,'COMMA',2,'POINT')}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.trafficFeeYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.hourFeeYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.checkFeeYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.servicePriceYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.partPriceYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.artPriceYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" class="layui-gray" th:text="${item.priceSplit==2?#numbers.formatDecimal(item.guaranteePriceYuan,1,'COMMA',2,'POINT'):'-'}">
                </td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.unit}" style="text-align: center">unit</td>


                <td th:if="${faultTariff.tariffType != 4}" th:text="${T(com.zmn.plat.manager.dictionary.ProductDict).getMutex(item.mutexMode)}" style="text-align: center">mutexMode</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.cityLimit==2?'影响':'不影响'}" style="text-align: center">cityLimit</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.brandLimit==2?'影响':'不影响'}" style="text-align: center">brandLimit</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.editEnable==2?'编辑':'不编辑'}" style="text-align: center">editEnable</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.show==2?'显示':'不显示'}" style="text-align: center">show</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.takePicture==2?'拍照':'不拍照'}" style="text-align: center">takePicture</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.manualPrice==2?'修改':'不修改'}" style="text-align: center">manualPrice</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.desc}" style="text-align: center">desc</td>
                <!--                <td th:switch="${item.afterService}">-->
                <!--                    <div th:case="1">部分保修</div>-->
                <!--                    <div th:case="2">整机保修</div>-->
                <!--                    <div th:case="3">不保修</div>-->
                <!--                </td>-->
                <!--                <td th:text="${item.afterServiceDesc}" style="text-align: center">afterServiceDesc</td>-->
                <!--                <td th:text="${item.afterServiceDay==null?'':item.afterServiceDay+'天'}" style="text-align: center">afterServiceDay</td>-->

                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.serviceRatio}" style="text-align: center">serviceRatio</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.partRatio}" style="text-align: center">partRatio</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.artRatio}" style="text-align: center">artRatio</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.guaranteeRatio}" style="text-align: center">guaranteeRatio</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.groupId}" style="text-align: center">groupId</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.negotiableMinPriceYuan}" style="text-align: center">negotiableMinPrice</td>
                <td th:if="${faultTariff.tariffType != 4}" th:text="${item.negotiableMaxPriceYuan}" style="text-align: center">negotiableMaxPrice</td>
                <td>
                    <a th:if="${#authPermit.checkPermit('/product/tariff/item/city/price/list.action') && faultTariff != null && faultTariff.priceType == 2}" th:onclick="toCityPrice([[${item.productId}]], [[${item.tariffId}]], [[${item.groupId}]], [[${item.itemId}]], [[${item.priceStandard}]]);" style="color: #00a0e9" lay-text='城市价格'>城市价格</a>

                    <a th:if="${#authPermit.checkPermit('/product/tariff/tariffproductitem3/setPrice.action') && faultTariff != null && faultTariff.tariffType == 4}" th:onclick="setPrice([[${item.itemId}]],[[${productFaultGroupVO.productId}]])" style="color: #00a0e9" lay-text='设置基础价'>设置基础价</a>
                    <!--                     <a th:if="${#authPermit.checkPermit('/product/tariff/tariffproductitem3/setPrice.action') && faultTariff != null && faultTariff.tariffType == 4}" th:href="'/product/tariff/tariffproductitem3/setPrice.action?serviceItemId='+${item.itemId}+'&&productId='+${productFaultGroupVO.productId}" style="color: #00a0e9" lay-text='设置基础价'>设置基础价</a>-->
                </td>
            </tr>
            </tbody>
        </table>
    </zmn>
</div>

